home *** CD-ROM | disk | FTP | other *** search
/ The Trig Explorer / The Trig Explorer.iso / mac / Explorer / ANGLES.dxr / 00123.ls < prev    next >
Encoding:
Text File  |  1998-07-22  |  722 b   |  26 lines

  1. on enterFrame
  2.   set xCenter to the locH of sprite 3
  3.   set yCenter to the locV of sprite 3
  4.   set radius to (the width of sprite 3 / 2) - 2
  5.   puppetSprite(4, 1)
  6.   repeat with n = 0 to 390
  7.     if the mouseDown then
  8.       exit repeat
  9.     end if
  10.     set dy to float(radius) * float(sin((360 - n) * PI / 180.0))
  11.     set dx to float(radius) * float(cos(n * PI / 180.0))
  12.     drawLine(4, yCenter, xCenter, yCenter + dy, xCenter + dx)
  13.     put n & " Degrees" into field "Degree"
  14.     updateStage()
  15.     startTimer()
  16.     repeat while the timer < 1
  17.       if the mouseDown then
  18.         exit repeat
  19.       end if
  20.     end repeat
  21.   end repeat
  22.   put "390 Degrees" into field "Degree"
  23.   puppetSprite(4, 0)
  24.   set the trails of sprite 4 to 0
  25. end
  26.